UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'l4aTeQoaxDoy04U6enSu+Xpo7Vo1wTo6QcZA9J6Lhtg='
WHERE
key_id = 'ca083e7d9f5d5ed676bac166aca56321242cdaf5e7a143593b5a19bc2949221e'
AND (
token = 'l4aTeQoaxDoy04U6enSu+Xpo7Vo1wTo6QcZA9J6Lhtg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)