UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'zml/JlZ+YxvfGoP0+FOR5p0WRORRrdWaS47k0IovPCw=' 
WHERE 
  key_id = 'ed668d8c39c7fa938dab259497fccd6c93b480376bed98daf2051122c0008b02' 
  AND (
    token = 'zml/JlZ+YxvfGoP0+FOR5p0WRORRrdWaS47k0IovPCw=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00033