UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'PW51YBbHvCt+F3cul/cb3x7WXuPDnO/e48jwxr/Uvfg='
WHERE
key_id = '19cf13afcabeddb49217920b4fcf1d29bb5dce17b8fd2213b18cc4fe2031cc8f'
AND (
token = 'PW51YBbHvCt+F3cul/cb3x7WXuPDnO/e48jwxr/Uvfg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)