UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'tysSH4VsUnR7MyRypgdkqp9WmBZfZO/ZYdjV1f3OIzE='
WHERE
key_id = '4c7ac181692957a26e3d352f8565ac665882f70eb1e90329c87bc699e2b016de'
AND (
token = 'tysSH4VsUnR7MyRypgdkqp9WmBZfZO/ZYdjV1f3OIzE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)