UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'KcI9yxm8lef2DtrsKnOydXnObzcsKDBWPqrlh6dYpKM='
WHERE
key_id = 'bc6f16b55edf707b266b597b5dfb4ba3d281765bbce93b45f107977602909c20'
AND (
token = 'KcI9yxm8lef2DtrsKnOydXnObzcsKDBWPqrlh6dYpKM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)