UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '44ivIUecKm2FEgPJqvXiz37gxGeI1cnbbsQZ13nOF1c='
WHERE
key_id = '5967ceeee2d2a2799b0c38f61f1a4b16faebd6507edec6766923a617cde0d831'
AND (
token = '44ivIUecKm2FEgPJqvXiz37gxGeI1cnbbsQZ13nOF1c='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)