UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'DAXqZlED6k14G8IGWjLurQ0EmSMdpaykUXBsy2AqQFE='
WHERE
key_id = 'f2004bc46a9a1be1c65247a03fd9c5400d2344995902694f4a00f8a71577da52'
AND (
token = 'DAXqZlED6k14G8IGWjLurQ0EmSMdpaykUXBsy2AqQFE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)