UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'IksXGSaqvUyyssakLGHebO/0CJ1j67mGuU2d2ZgtwEg='
WHERE
key_id = '1ababb9f91e3e8bca36fe087157ab2b9017ab647a2bb86b3576539865ff793ef'
AND (
token = 'IksXGSaqvUyyssakLGHebO/0CJ1j67mGuU2d2ZgtwEg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)