UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'nRfCK8k2AMy2RJkjoRLmR5MyHuRBd6eCkBYTinFk44s='
WHERE
key_id = '355f2f293197b3238884dcc20ed81b485785cd7a88290836d07dbf4e2766ef5a'
AND (
token = 'nRfCK8k2AMy2RJkjoRLmR5MyHuRBd6eCkBYTinFk44s='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)