UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '0j79AH2No/44QtRbIosryL7CaPE/RXihGu7IF6j/bCc=' 
WHERE 
  key_id = 'c861ab6a9b7007d3e78d5e6df93e5f6371f065a5dca6364bd9962d4f7990c730' 
  AND (
    token = '0j79AH2No/44QtRbIosryL7CaPE/RXihGu7IF6j/bCc=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00033