UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '26+770G87Drz7nXkws3r6O3DlAguaSpn6cVQGOuRp9I='
WHERE
key_id = 'c387d81d4c72c329854248b6d1375926e840e6f73d11aae02ccc95d4097d3c86'
AND (
token = '26+770G87Drz7nXkws3r6O3DlAguaSpn6cVQGOuRp9I='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)