UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'aOTTx8LBQ9fEahrAFnwh1nvld0FmPhgBdRlDYXBvwvY='
WHERE
key_id = '3c1920aa2c5d8497ca971245019da58320a5f4c870d8156b746209206fcbc043'
AND (
token = 'aOTTx8LBQ9fEahrAFnwh1nvld0FmPhgBdRlDYXBvwvY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)