UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'ISlydpPA5YVhZurszot2OuNaAbabh290nCAW03C2VC4='
WHERE
key_id = 'e61f2a2394792a27dc28d374b7f58e622e91903e0dc223c1262452a470988c7a'
AND (
token = 'ISlydpPA5YVhZurszot2OuNaAbabh290nCAW03C2VC4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)