UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'G2H+B+UE8tggVJwG1292oVP9+l1rPbXQGQikOIUBpvA=' 
WHERE 
  key_id = '6240983708235bb37b74cbc54d27a9bf95cd00f61fcdefec16b2e25feb60edc7' 
  AND (
    token = 'G2H+B+UE8tggVJwG1292oVP9+l1rPbXQGQikOIUBpvA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00019