UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'eKoyRj4cXbnISVVhvVTMasx1X6C/+OKNlt4rrVM6IUE='
WHERE
key_id = 'bc447044a262447dd2c965dffb09a05c2c76286f06e4e3c875bd0c2332bdf92c'
AND (
token = 'eKoyRj4cXbnISVVhvVTMasx1X6C/+OKNlt4rrVM6IUE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)