UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Htqrls/smTLPuK7Dnbx1yhH4sqEu2Sit5sm2CXYZ+gU='
WHERE
key_id = '2d7daff6de67fb2bb7d96d993a998a0c24435e7a3a45ba11cd17d53c4afda95f'
AND (
token = 'Htqrls/smTLPuK7Dnbx1yhH4sqEu2Sit5sm2CXYZ+gU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)