UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'PbALALyArFMV92v6y/sToqS9VUTyWpRG7b/Gmzadk10='
WHERE
key_id = 'b231f9d8bfc0f543415a7371aa0df638cad08fa83c00f2319f56068f1b3df049'
AND (
token = 'PbALALyArFMV92v6y/sToqS9VUTyWpRG7b/Gmzadk10='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)