UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'otv2LoLORHIEMqIWA7nmqXzT4clLigAwG1YJ4oCbrjI='
WHERE
key_id = '5ec015a921634896700e847cb50c1d79bd9fe89412094b725783cd419d8fc3de'
AND (
token = 'otv2LoLORHIEMqIWA7nmqXzT4clLigAwG1YJ4oCbrjI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)