UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '8JAiBlmcvARhsCekbI3780+r3Uioh/kXlWCgNfovZeU='
WHERE
key_id = '50d398235d36a8b1b5ca8812eb7366ac41edda8cb0eb27a658a833ac090c54e3'
AND (
token = '8JAiBlmcvARhsCekbI3780+r3Uioh/kXlWCgNfovZeU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)