UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Bk+xPuu1+K/0HsjN2ox/kXx6o2JGnEBabwC8BDKsYn0='
WHERE
key_id = '7388ae123c99f3eb4bac805242f89bef77f91870c89e3d9abc532a97cbf29357'
AND (
token = 'Bk+xPuu1+K/0HsjN2ox/kXx6o2JGnEBabwC8BDKsYn0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)