UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'DfYBqbNA8bg9fFGOf+2BqnkCVDqBblR66f73PjmTKvY='
WHERE
key_id = 'c18681554107515fa649845a588c72e8bf40f72ebfc101ba353c0b19972485a0'
AND (
token = 'DfYBqbNA8bg9fFGOf+2BqnkCVDqBblR66f73PjmTKvY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)