UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'C3bLGWt/0kVNiTh2GqwTTDQtxexQzJKSYXvdsqUbitw='
WHERE
key_id = '91da59b75a23e07231d4ca8d49a798bf1425058de97305454d41fe8263cd9350'
AND (
token = 'C3bLGWt/0kVNiTh2GqwTTDQtxexQzJKSYXvdsqUbitw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)