UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '6yR63EfVzsfhaVCrHjS1W4JcKOGzzD+Iy3xTnxnY/sY='
WHERE
key_id = 'cb5128b7d84573fdb28b3572b2e78081b19b70a5b4d040a2fedf04798efc9400'
AND (
token = '6yR63EfVzsfhaVCrHjS1W4JcKOGzzD+Iy3xTnxnY/sY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)