UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '0m2KVNr3+mDm+xoxv6kZdCqtIB/1P3GKdDZhnCk3hHQ=' 
WHERE 
  key_id = 'afde4e4b8ecbf3438312b5263bd71a5615d8da23db27c2ef287fa4e463d15d0c' 
  AND (
    token = '0m2KVNr3+mDm+xoxv6kZdCqtIB/1P3GKdDZhnCk3hHQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00041