UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'ewxpWxmiKsErEP5cA6Se/xrcXSmbncqwsX6CVpHz52s='
WHERE
key_id = 'fc8daffaef4710cfa45ce526fca8d9deed47ce16783c24074ba6bd7d60276343'
AND (
token = 'ewxpWxmiKsErEP5cA6Se/xrcXSmbncqwsX6CVpHz52s='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)