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