UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'VhK1UsMlyvQGd7NqW8tyDu0cpC2VSICmYZbd7Y4pRXM=' 
WHERE 
  key_id = '69b5ff586f7c11a217c6c58fce45c2290a22bd2a84abba7d346c28be50c5286c' 
  AND (
    token = 'VhK1UsMlyvQGd7NqW8tyDu0cpC2VSICmYZbd7Y4pRXM=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00040