UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'aNA1Dpj3Uu6LCaiu2MYtml0GOoZmH0z517znV2n3NgY='
WHERE
key_id = '79987dd819cf6d2d39fc8f9cf5aeed1a5a7c2100b63d5132ee42e11ede59be6e'
AND (
token = 'aNA1Dpj3Uu6LCaiu2MYtml0GOoZmH0z517znV2n3NgY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)