UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'K66kX7s99eB/ZQJ+FMlxgQOOOTLQREaXF9QyGKRSKOg=' 
WHERE 
  key_id = '23de349437bbcc0f90e5c66fb7a9bc0b41bd68aa0d3cff0d9c36d0ef9bdcbae2' 
  AND (
    token = 'K66kX7s99eB/ZQJ+FMlxgQOOOTLQREaXF9QyGKRSKOg=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00040