UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'L7rqnDYkdeLyso/1ojLYviq2SGDS5AsN7uPL+oIr7mw=' 
WHERE 
  key_id = 'a53653a98707c1ad78f8e9f55c79a67fb0622602e5a2acad65b0e0831bedeb1c' 
  AND (
    token = 'L7rqnDYkdeLyso/1ojLYviq2SGDS5AsN7uPL+oIr7mw=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00098