UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'F/XIMWyfWSowyhxMQR5XOci+5W9U/iq9WKUvCoAPyuI=' 
WHERE 
  key_id = 'b5563cf365c93b2da672b2c96fb95c9e4200a6816e526ce1ee64b3671996f71a' 
  AND (
    token = 'F/XIMWyfWSowyhxMQR5XOci+5W9U/iq9WKUvCoAPyuI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00027