UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'BnHPplTkVgPO13p/nqr3XKEfYazwEJbF5ix3w+BNLk4='
WHERE
key_id = '87f1db384a5105956d0620f5340e8ea092fc9ed787aac2120f7fd57811d252a0'
AND (
token = 'BnHPplTkVgPO13p/nqr3XKEfYazwEJbF5ix3w+BNLk4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)