UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'mIkp1P+s+KTW8s9MiZI2claWp3q3UZjV4s5ujOw7GTs='
WHERE
key_id = 'df0c086d87790868660fde2d60d267138a0aed6ea1deda333f31f2f4768ecf55'
AND (
token = 'mIkp1P+s+KTW8s9MiZI2claWp3q3UZjV4s5ujOw7GTs='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)