UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'UGssg4jgqgkVaD74hK9NrMKYDiER5KNSxd5DrT0B8so='
WHERE
key_id = '08ec34ab75b86c707c3a6f6350e972bf6b49c161b5c6135d6541e226da90ca8f'
AND (
token = 'UGssg4jgqgkVaD74hK9NrMKYDiER5KNSxd5DrT0B8so='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)