UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'jiBWLke3PLXTsAg9BGbJUWLQzWByhLSmSfy8/ry2jAQ=' 
WHERE 
  key_id = '9a5b3afbca9a8876a8576d34cf086afb4c3aca326296d2eaf4cb901301b0a51a' 
  AND (
    token = 'jiBWLke3PLXTsAg9BGbJUWLQzWByhLSmSfy8/ry2jAQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00033