UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '122wOVwE2Y6WcBgGljB94CbjMFSsm3jtY6fpuXhGvWI='
WHERE
key_id = '240661a5d2ae12be3b4ce76944bea5425eea55fbb45d2b4603977d14dd501f9d'
AND (
token = '122wOVwE2Y6WcBgGljB94CbjMFSsm3jtY6fpuXhGvWI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)