UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'RdmJ4jMmxoj+xUkOKV18C8akjLDroJHhfIbHuzO4qqg='
WHERE
key_id = 'c984d8192ddb333d3b6062035293ba26e3dcc57237364de4b685219f226b1986'
AND (
token = 'RdmJ4jMmxoj+xUkOKV18C8akjLDroJHhfIbHuzO4qqg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)